import React, { Component } from 'react';
import './style.scss'
import classnames from 'classnames'
class DemoCLassArr extends Component {
    state = {  
      show: false
    } 
    render() { 
        return (
        <div className=''>
           动态class-数组方式:
           <div className='classA'>颜色?</div>
           <div className={[this.state.show ? 'classA' : 'classC classD', 'calssB'].join(' ')}>颜色?</div>
           {/* classnames */}
           <div className={classnames('classA', 'classB')}>classnames-动态class</div>
           <div className={classnames({show: true})}>classnames-动态class</div>
           <div className={classnames('a',['a1', 'ab'])}>classnames-动态class</div>
        </div>
        );
    }
}
 
export default DemoCLassArr;